<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>显示设置</title>
    <link rel="stylesheet" href="/static/component/pear/css/pear.css"/>
    <link rel="stylesheet" href="/static/component/markdown/editor/editormd.min.css" />
    <script src="/static/component/layui/layui.js"></script>
    <script src="/static/component/pear/pear.js"></script>
    <script src="/static/component/pear/module/ruinuo/sortable.js"></script>
    <script src="/static/component/pear/module/ruinuo/xm-select.js"></script>
</head>
<body>
<div class="view_body">
    <form class="layui-form" action="">
        <div class="mainBox ruinuo_box">
            <div class="main-container layui-row layui-col-space10 label_con view_browse">
            </div>
        </div>
    </form>
</div>
<script type="text/html" id="view_browse_data"></script>
<script>
    let $ = layui.jquery;
    let jQuery=$;
</script>
<script src="/static/component/markdown/editor/editormd.min.js"></script>
<script>
    let SettingData = {};
    let SeleteData = {};
    let current=1;
    let raw = '';
    let InitData = {};
    let form_config={
        onclick: {},
    }
    layui.use(['form', 'http', 'public', 'engine_form','design_form'], function () {
        init();
    })
    function init() {
        let item=parent.layui.design_form.GetSetting();
        let fields=parent.layui.design_form.GetFieldData();
        let Postdata = {
            layout: JSON.stringify(item.data),
        };
        let onclick=[];
        fields.forEach(item=>{
            let event_val=item.event_val || [];
            event_val.forEach(item2=>{
                item2['field']=item.field;
                item2['tag']=item.tag;
                onclick.push(item2);
            })
            let gongshi_txt=item.gongshi_txt || '';
            if (gongshi_txt)
            {
                onclick.push({field:item.field,tag:item.tag,gongshi_txt:gongshi_txt});
            }
        });
        form_config.onclick=onclick;
        layui.http.SendAjax('/ruinuo/design.form/browse', Postdata, [], function (res) {
            let html=res.data.html || '';
            InitData['detail'] = res.data.detail || {};
            InitData['source'] = res.data.source || {};
            console.log(InitData);
            $("#view_browse_data").html(html);
            layui.public.ViewTpl(InitData, 'view_browse_data', 'view_browse');
            layui.design_form.BindAciton(item.data);
            layui.engine_form.BindEvent();
            layui.form.render();
        })
    }

</script>
</body>
</html>